{% extends "base.html" %}

{% block title %}CNInfo - 行业深度研报{% endblock %}

{% block page_title %}行业深度研报{% endblock %}
{% block page_subtitle %}专业的行业分析和深度研究报告{% endblock %}

{% block extra_css %}
<style>
    /* 深度研报表格列宽 */
    th:nth-child(1), td:nth-child(1) { width: 15%; min-width: 100px; } /* 报告标题 */
    th:nth-child(2), td:nth-child(2) { width: 20%; min-width: 120px; } /* 来源 */
    th:nth-child(3), td:nth-child(3) { width: 45%; min-width: 200px; } /* 摘要 */
    th:nth-child(4), td:nth-child(4) { width: 20%; min-width: 140px; } /* 日期 */

    /* 移动端调整 */
    @media (max-width: 768px) {
        th:nth-child(1), td:nth-child(1) { width: 20%; min-width: 80px; }
        th:nth-child(2), td:nth-child(2) { width: 25%; min-width: 100px; }
        th:nth-child(3), td:nth-child(3) { width: 35%; min-width: 150px; }
        th:nth-child(4), td:nth-child(4) { width: 20%; min-width: 120px; }
    }
</style>
{% endblock %}

{% block content %}
<div class="table-container">
    <table>
        <thead>
            <tr>
                <th>报告标题</th>
                <th>来源</th>
                <th>摘要</th>
                <th>发布日期</th>
            </tr>
        </thead>
        <tbody>
            {% for item in data %}
            <tr>
                <td><a href="{{ item.reportUrl }}" target="_blank">{{ item.reportTitle }}</a></td>
                <td>{{ item.source }}</td>
                <td>{{ item.summary }}</td>
                <td>{{ item.reportDate }}</td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</div>
{% endblock %}

{% block pagination %}
{% if pages and page %}
<div class="pagination">
    <h3>共 {{pages}} 页</h3>
    <div class="pagination-links">
        {% if page > 1 %}
        <a href="{{ request.url.replace_query_params(page=page-1) }}">← 上一页</a>
        {% endif %}
        <span class="current-page">当前为第 {{page}} 页</span>
        {% if page < pages %}
        <a href="{{ request.url.replace_query_params(page=page+1) }}">下一页 →</a>
        {% endif %}
    </div>
</div>
{% endif %}
{% endblock %}

{% block extra_js %}
<script>
    // 页面加载完成后的处理
    window.addEventListener('DOMContentLoaded', function() {
        // 可以在这里添加深度研报特有的JavaScript逻辑
        console.log('深度研报页面加载完成');
    });
</script>
{% endblock %}
